<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript" src="/lookdom/js/jquery-1.8.0.js" charset="UTF-8"></script>
</head>
<body>
	<input type="button" onclick="goIndex();" value="인덱스페이지"> <br><br>
	<table border="1">
		<tr>
			<td>id</td>
			<td>
				<input type="text" id="id" size="10">
			</td>
		</tr>
		<tr>
			<td>pw</td>
			<td>
				<input type="text" id="pw" size="10">
			</td>
		</tr>
		<tr>
			<td>name</td>
			<td>
				<input type="text" id="name" size="10">
			</td>
		</tr>
		<tr>
			<td>nickname</td>
			<td>
				<input type="text" id="nickname" size="10">
			</td>
		</tr>
		<tr>
			<td>telnumber</td>
			<td>
				<input type="text" id="telnumber" size="10">
			</td>
		</tr>
		<tr>
			<td>
				<input type="button" size="10" value="회원가입" onclick="signUp();">
			</td>
			<td>
				<input type="button" size="10" value="회원리스트" onclick="userList();">
			</td>
		</tr>
	</table>
</body>

<script type="text/javascript">
	function signUp(){
		var id = $("#id").val();
		var pw = $("#pw").val();
		
		var url = "/lookdom/signUp3.do?" + "id=" + id + "&pw=" + pw;
		//alert(id);
		$.ajax({
			type	: "POST",
			url		: url,
			//dataType: "json",
			data	: "",
			 success	: function() {
					//alert("성공");
				 var url = "/lookdom/userList.do";    
				 $(location).attr('href',url);
			} ,
	         error: function(xhr, status, error) {
	        	 alert('error-'+error); 
	         }
		});
	}
	
	function userList() {
		var url = "/lookdom/userList.do";
		$(location).attr('href',url);
	}
	
	function goIndex() {
		var url = "/lookdom/index.do";
		$(location).attr('href',url); 
	}
</script>

</html>